package com.xiaoq.ar.service.impl;

import com.xiaoq.ar.entity.MyTreasureEntity;
import com.xiaoq.ar.entity.Punchs;
import com.xiaoq.ar.repository.MyTreasureRepository;
import com.xiaoq.ar.service.MyTreasureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chenjh on 2018/3/5.
 */
@Service
public class MyTreasureServiceImpl implements MyTreasureService {

    @Autowired
    private MyTreasureRepository myTreasureRepository;

    @Override
    public boolean save(MyTreasureEntity entity) {
        return myTreasureRepository.save(entity);
    }

    @Override
    public MyTreasureEntity getByArActivityUserId(String arActivityId, String userId) {
        return myTreasureRepository.getByArActivityUserId(arActivityId, userId);
    }

    @Override
    public boolean addPunchs2MyTreasure(String myTreasureId, Punchs punchs) {
        return false;
    }


    @Override
    public boolean updateMyTreasureById(MyTreasureEntity myTreasureEntity) {
        return myTreasureRepository.updateById(myTreasureEntity);
    }

    @Override
    public List<MyTreasureEntity> getListByUserId(String userId) {
        return myTreasureRepository.getListByUserId(userId);
    }
}
